package testJdk.commonUse.collections.set;

import org.junit.Test;

import java.util.Set;
import java.util.TreeSet;

/**
 * @version 1.0.0
 * Created by cyd on 2023-07-05 15:34:49
 * @ClassName : testJdk.commonUse.collections.set.TestTreeSet
 * @Description : 类描述
 */
public class TestTreeSet {

    /**
     * TreeSet中的元素是自然排序的且不重复
     */
    @Test
    public void test() {
        String str = "ccddbbaaDDAA";
        Set<Character> set = new TreeSet<>();
        for (char c : str.toCharArray()) {
            set.add(c);
        }
        System.out.println(set.toString());
    }


}
